package main

import (
	"fmt"

	"gitee.com/suplinux/lesson/v3/config"
	"gitee.com/suplinux/lesson/v3/handlers"
	"github.com/gin-gonic/gin"
)

func main() {
	var mypath string = "application.yaml"
	config.LoadConfigFromYaml(mypath)
	ac := config.C().Application
	router := gin.New()
	router.Use(gin.Logger(), gin.Recovery())
	handlers.Book.Registry(router)
	router.Run(fmt.Sprintf("%s:%d", ac.Host, ac.Port))
}
